<?php
/**
 * Tests for term Extractor
 *
 * PHP version 5
 *
 * @package    TV
 * @subpackage Tests
 * @author     Mike Bevz <mike.bevz@tourstart.dk>
 * @copyright  2007-2008 (c) Mike Bevz
 * @version    SVN: $Id: AnalyzerTests.php 7 2008-11-28 04:33:32Z michael.bevz $
 *
 *
 */

/**
 * Includes below
 */
require_once dirname(__FILE__).'/../testsConfig.php';
require_once 'PHPUnit/Framework.php';


/**
 * Model for Term Extractor
 *
 * PHP version 5
 *
 * @package    Tourstart
 * @subpackage Tests
 * @author     Mike Bevz <mike.bevz@tourstart.dk>
 * @copyright  2007-2008 (c) Tourstart.dk
 * @license    http://tourstart.dk/license Tourstart License
 * @version    SVN: $Id: AnalyzerTests.php 7 2008-11-28 04:33:32Z michael.bevz $
 * @link       http://mantis.dev.tourstart.dk/wiki/TS_Auth_Adapter
 *
 */

class TermExtractorTests extends PHPUnit_Framework_TestCase
{
    /**
     * Analyzer class
     *
     * @var TV_Text_TermExtractor
     */
    private $_analizer;
    
    /**
     * Text for analysis
     *
     * @var string
     */
    private $_text;
    
    protected function setUp()
    {
        $this->_text = 'The Josephson Institute, a Los Angeles-based ethics institute, surveyed 29,760 students at 100 randomly selected high schools nationwide, both public and private. All students in the selected schools were given the survey in class; their anonymity was assured.';

        $this->_analizer = new TV_Text_TermExtractor();
    }

    protected function tearDown()
    {
      unset($this->_analizer);
    }
    

    public function testGetTagsReturnsTagArray()
    {
        $expected = array('josephson institute', 'ethics institute', 'anonymity', 'high schools');
        $actual   = $this->_analizer->getTags($this->_text);
        $this->assertEquals($expected, $actual);
    }
    
    /**
     * @expectedException TV_Text_Exception
     *
     */
    public function testGetTagsAcceptsOnlyString()
    {
        $this->_analizer->getTags(array());
    }
    

    
    
}